<template>
	<view>
		<nav-bars title="银行名称"></nav-bars>
		<view class="Search">
			<u-search
				placeholder="搜索您感兴趣的内容吧"
				placeholder-color="#939393"
				:show-action="true"
				v-model="keyword"
				@clear="SearchChange"
				@search="EnterClick"
				@custom="customSearch"
				:animation="false"
				action-text="搜索"
			></u-search>
		</view>
		<view class="list">
			<view class="item" v-for="(item, index) in BankList" @click="ClickBank(item, index)" :key="index">{{ item.BAF_NAME }}</view>
		</view>
	</view>
</template>
<script>
import Https from '@/service/verification.js';
export default {
	name: '',
	components: {},
	data() {
		return {
			keyword: '',
			BankList: []
		};
	},
	mounted() {},
	onShow() {
		this.GetBankNameList();
	},
	methods: {
		// 输入框内容发生变化时触发
		SearchChange(e) {
			this.GetBankNameList();
		},
		// 用户确定搜索时触发，用户按回车键，或者手机键盘右下角的"搜索"键时触发
		EnterClick(row) {
			this.GetBankNameList();
		},
		// 用户点击右侧控件时触发
		customSearch(row) {
			this.GetBankNameList();
		},
		GetBankNameList() {
			var that = this;
			let params = {
				BAF_NAME: that.keyword
			};
			Https.GetBankName(params).then(res => {
				if (res.code == 1) {
					// console.log(res.data);
					var data = res.data;
					that.BankList = data;
				} else {
					uni.showToast({
						title: res.msg,
						icon: 'none'
					});
				}
			});
		},
		ClickBank(row, index) {
			var that = this;
			var BankCode = row.BANKCODE;
			console.log(row);
			uni.navigateTo({
				url: `/pages_Verification/verification/keywordBank/BankCode/list?BankCode=${BankCode}&BankName=${row.BAF_NAME}`
			});
		}
	}
};
</script>
<style lang="less">
page {
	background: #fff;
}
.Search {
	background: #fff;
	width: 100%;
	flex: 1;
	padding: 16rpx 32rpx;
	// border-top: 1px solid #f6f7fb;
	border-bottom: 1px solid #f6f7fb;
	position: fixed;
}
.list {
	margin-top: 50px;
	.item {
		margin: 12rpx 0;
		border-bottom: 1px solid #f6f7fb;
		padding: 32rpx;
		font-size: 30rpx;
	}
}
</style>
